home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _58ee18671465d9096d70c88bd40106a4 < prev    next >
Encoding:
Text File  |  2002-06-17  |  1.1 KB  |  45 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Scrollbar.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Scrollbar;
  5.  
  6. #line 247 "..\blib\lib\Tk\Scrollbar.pm (autosplit into ..\blib\lib\auto\Tk\Scrollbar\Drag.al)"
  7. # tkScrollDrag --
  8. # This procedure is called for each mouse motion even when the slider
  9. # is being dragged.  It notifies the associated widget if we're not
  10. # jump scrolling, and it just updates the scrollbar if we are jump
  11. # scrolling.
  12. #
  13. # Arguments:
  14. # w -        The scrollbar widget.
  15. # x, y -    The current mouse position.
  16.  
  17. sub Drag
  18. {my $w = shift;
  19.  my $e = $w->XEvent;
  20.  return unless (defined $initMouse);
  21.  my $f = $w->fraction($e->x,$e->y);
  22.  my $delta = $f - $initMouse;
  23.  if ($w->cget('-jump'))
  24.   {
  25.    if (@initValues == 2)
  26.     {
  27.      $w->set($initValues[0]+$delta,$initValues[1]+$delta);
  28.     }
  29.    else
  30.     {
  31.      $delta = int($delta * $initValues[0]);
  32.      $initValues[2] += $delta;
  33.      $initValues[3] += $delta;
  34.      $w->set(@initValues);
  35.     }
  36.   }
  37.  else
  38.   {
  39.    $w->ScrlToPos($initPos+$delta);
  40.   }
  41. }
  42.  
  43. # end of Tk::Scrollbar::Drag
  44. 1;
  45.